package pl.edu.mimuw.irs.rcp.controller.editor.workflow.menu.builder;

import java.util.LinkedList;
import java.util.List;

import org.eclipse.gef.EditPart;
import org.eclipse.jface.action.IMenuManager;

import pl.edu.mimuw.irs.rcp.controller.editor.workflow.part.IRSNodeEditPart;

/**
 * @author Jakub Rauch
 * Created on: 2009-05-21
 */
public class NodeContextMenuBuilder extends AbstractContextMenuBuilder {

	// *** Attributes
	
	// *** Methods
	
	public void build(IMenuManager menu) {
		
		List<IRSNodeEditPart> nodeEditParts = new LinkedList<IRSNodeEditPart>();
		for (EditPart part : getSelection()) {
			if (part instanceof IRSNodeEditPart) {
				nodeEditParts.add((IRSNodeEditPart)part);
			}
		}
		
//		if (nodeEditParts.size() == 1) {
//			IRSNodeEditPart nodeEditPart = nodeEditParts.get(0);
//			IRSNodeInterface node = nodeEditPart.getIRSNode();
//			Set<Type> types = node.getSupportedFragmentations();
//			
//			// Fragmentation
//			/*for (Type type : types) {
//				menu.add(new FragmentationAction(nodeEditPart, new Fragmentation(type)));
//			}*/
//			
//			
//			// Expand-collapse
//			/*if (!node.isRoot()) {
//				menu.add(new ExpandCollapseAction(nodeEditPart, ExpandCollapseAction.Type.COLLAPSE));
//			}
//			if (!Fragmentation.Type.NONE.equals(node.getFragmentation().getType())) {
//				menu.add(new ExpandCollapseAction(nodeEditPart, ExpandCollapseAction.Type.EXPAND));
//			}*/
//		}
	}
}
